using log4net;
using log4net.Config;
using SilverSea.Untilities;
using SilverSea.Video.Tools;
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.IO;
using System.Reflection;
using System.Windows.Forms;
public sealed class frmViolationReport : Form
{
	private IContainer icontainer_0;
	private ToolStrip toolStrip1;
	private ToolStripButton btnRefresh;
	private ToolStripSeparator toolStripSeparator2;
	private ToolStripButton btnExport;
	private ToolStripSeparator toolStripSeparator4;
	private ToolStripButton btnPrintPreview;
	private ToolStripSeparator toolStripSeparator7;
	private ToolStripButton btnClose;
	private Panel panel1;
	private GroupBox groupBox1;
	private TextBox txtPlateNumber;
	private Label label8;
	private DateTimePicker dtpTimeFrom;
	private DateTimePicker dtpTimeTo;
	private Button btnRunReport;
	private Label label2;
	private Label labelTo;
	private DateTimePicker dtpDateFrom;
	private DateTimePicker dtpDateTo;
	private PictureBox picVehicleImage;
	private DataGridView dataGridView1;
	private PictureBox picPanoramaImage;
	private Label label3;
	private Label label1;
	private Label lblNumberRecord;
	private Button btnBack;
	private Button btnNext;
	private Button btnDel;
	private Button btnSave;
	private ComboBox cbxVehicleType;
	private TextBox txtLicensePlate;
	private PictureBox picPlateImage;
	private GroupBox groupBox2;
	private Button btnPrintAll;
	private Button btnPrint;
	private CheckBox chkEnablePreview;
	private Label label4;
	private ComboBox cbxOrder;
	private Label lblFileToPrint;
	private Timer timer_0;
	private Label lblBlackList;
	private CheckBox chkCheckBlackSpecialList;
	private Label lblSpecialList;
	private DataGridViewTextBoxColumn IDColumn;
	private DataGridViewTextBoxColumn IDValueColumn;
	private DataGridViewTextBoxColumn DateColumn;
	private DataGridViewTextBoxColumn TimeColumn;
	private DataGridViewTextBoxColumn VehicleType;
	private DataGridViewTextBoxColumn PlateNumberColumn;
	private DataGridViewTextBoxColumn RecognizeTimeColumn;
	private DataGridViewTextBoxColumn VehicleImagePathColumn;
	private DataGridViewTextBoxColumn PanoramaImagePathColumn;
	private DataGridViewTextBoxColumn RedLightImagePathColumn;
	private DataGridViewTextBoxColumn DescriptionColumn;
	private string string_0 = string.Empty;
	private string string_1 = string.Empty;
	private System.Collections.Queue queue_0 = new System.Collections.Queue();
	private BackgroundWorker backgroundWorker_0;
    private IContainer components;
	private ILog ilog_0 = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
	public frmViolationReport()
	{
		this.InitializeComponent();
		BasicConfigurator.Configure();
		XmlConfigurator.Configure();
		System.Drawing.Color backColor = System.Drawing.Color.FromName(MainForm.SystemConfiguration_0.string_15);
		this.BackColor = backColor;
		ExportDGV.CompanyName = MainForm.SystemConfiguration_0.string_12;
		ExportDGV.CompanyAddress = MainForm.SystemConfiguration_0.string_11;
		PrintDGV.CompanyName = MainForm.SystemConfiguration_0.string_12;
		PrintDGV.CompanyAddress = MainForm.SystemConfiguration_0.string_11;
		PrintLPRInfo.DepartmentManagement = MainForm.SystemConfiguration_0.string_14;
		PrintLPRInfo.ViolationDescriptionDetails = MainForm.SystemConfiguration_0.string_13;
		PrintLPRInfo.LocationDetails = MainForm.SystemConfiguration_0.string_11;
		PrintLPRInfo.PersonManegementDetails = RegisterationInfo.gclass2_0.method_2();
		PrintLPRInfo.ColumnHeaders = new System.Collections.Generic.List<string>
		{
			"NGÀY",
			"GIỜ",
			"BIỂN SỐ"
		};
	}
	protected override void Dispose(bool disposing)
	{
		if (disposing && this.icontainer_0 != null)
		{
			this.icontainer_0.Dispose();
		}
		base.Dispose(disposing);
	}
	private void InitializeComponent()
	{
        this.components = new System.ComponentModel.Container();
        System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmViolationReport));
        this.toolStrip1 = new System.Windows.Forms.ToolStrip();
        this.btnRefresh = new System.Windows.Forms.ToolStripButton();
        this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
        this.btnExport = new System.Windows.Forms.ToolStripButton();
        this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();
        this.btnPrintPreview = new System.Windows.Forms.ToolStripButton();
        this.toolStripSeparator7 = new System.Windows.Forms.ToolStripSeparator();
        this.btnClose = new System.Windows.Forms.ToolStripButton();
        this.panel1 = new System.Windows.Forms.Panel();
        this.groupBox2 = new System.Windows.Forms.GroupBox();
        this.chkEnablePreview = new System.Windows.Forms.CheckBox();
        this.btnPrintAll = new System.Windows.Forms.Button();
        this.btnPrint = new System.Windows.Forms.Button();
        this.picPlateImage = new System.Windows.Forms.PictureBox();
        this.btnBack = new System.Windows.Forms.Button();
        this.txtLicensePlate = new System.Windows.Forms.TextBox();
        this.btnNext = new System.Windows.Forms.Button();
        this.label3 = new System.Windows.Forms.Label();
        this.btnDel = new System.Windows.Forms.Button();
        this.btnSave = new System.Windows.Forms.Button();
        this.picPanoramaImage = new System.Windows.Forms.PictureBox();
        this.groupBox1 = new System.Windows.Forms.GroupBox();
        this.lblSpecialList = new System.Windows.Forms.Label();
        this.chkCheckBlackSpecialList = new System.Windows.Forms.CheckBox();
        this.lblBlackList = new System.Windows.Forms.Label();
        this.lblFileToPrint = new System.Windows.Forms.Label();
        this.label4 = new System.Windows.Forms.Label();
        this.cbxOrder = new System.Windows.Forms.ComboBox();
        this.cbxVehicleType = new System.Windows.Forms.ComboBox();
        this.lblNumberRecord = new System.Windows.Forms.Label();
        this.label1 = new System.Windows.Forms.Label();
        this.txtPlateNumber = new System.Windows.Forms.TextBox();
        this.label8 = new System.Windows.Forms.Label();
        this.dtpTimeFrom = new System.Windows.Forms.DateTimePicker();
        this.dtpTimeTo = new System.Windows.Forms.DateTimePicker();
        this.btnRunReport = new System.Windows.Forms.Button();
        this.label2 = new System.Windows.Forms.Label();
        this.labelTo = new System.Windows.Forms.Label();
        this.dtpDateFrom = new System.Windows.Forms.DateTimePicker();
        this.dtpDateTo = new System.Windows.Forms.DateTimePicker();
        this.picVehicleImage = new System.Windows.Forms.PictureBox();
        this.dataGridView1 = new System.Windows.Forms.DataGridView();
        this.IDColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
        this.IDValueColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
        this.DateColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
        this.TimeColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
        this.VehicleType = new System.Windows.Forms.DataGridViewTextBoxColumn();
        this.PlateNumberColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
        this.RecognizeTimeColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
        this.VehicleImagePathColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
        this.PanoramaImagePathColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
        this.RedLightImagePathColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
        this.DescriptionColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
        this.timer_0 = new System.Windows.Forms.Timer(this.components);
        this.toolStrip1.SuspendLayout();
        this.panel1.SuspendLayout();
        this.groupBox2.SuspendLayout();
        ((System.ComponentModel.ISupportInitialize)(this.picPlateImage)).BeginInit();
        ((System.ComponentModel.ISupportInitialize)(this.picPanoramaImage)).BeginInit();
        this.groupBox1.SuspendLayout();
        ((System.ComponentModel.ISupportInitialize)(this.picVehicleImage)).BeginInit();
        ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
        this.SuspendLayout();
        // 
        // toolStrip1
        // 
        resources.ApplyResources(this.toolStrip1, "toolStrip1");
        this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.btnRefresh,
            this.toolStripSeparator2,
            this.btnExport,
            this.toolStripSeparator4,
            this.btnPrintPreview,
            this.toolStripSeparator7,
            this.btnClose});
        this.toolStrip1.Name = "toolStrip1";
        // 
        // btnRefresh
        // 
        resources.ApplyResources(this.btnRefresh, "btnRefresh");
        this.btnRefresh.Name = "btnRefresh";
        // 
        // toolStripSeparator2
        // 
        this.toolStripSeparator2.Name = "toolStripSeparator2";
        resources.ApplyResources(this.toolStripSeparator2, "toolStripSeparator2");
        // 
        // btnExport
        // 
        resources.ApplyResources(this.btnExport, "btnExport");
        this.btnExport.Name = "btnExport";
        this.btnExport.Click += new System.EventHandler(this.btnExport_Click);
        // 
        // toolStripSeparator4
        // 
        this.toolStripSeparator4.Name = "toolStripSeparator4";
        resources.ApplyResources(this.toolStripSeparator4, "toolStripSeparator4");
        // 
        // btnPrintPreview
        // 
        resources.ApplyResources(this.btnPrintPreview, "btnPrintPreview");
        this.btnPrintPreview.Name = "btnPrintPreview";
        this.btnPrintPreview.Click += new System.EventHandler(this.btnPrintPreview_Click);
        // 
        // toolStripSeparator7
        // 
        this.toolStripSeparator7.Name = "toolStripSeparator7";
        resources.ApplyResources(this.toolStripSeparator7, "toolStripSeparator7");
        // 
        // btnClose
        // 
        resources.ApplyResources(this.btnClose, "btnClose");
        this.btnClose.Name = "btnClose";
        this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
        // 
        // panel1
        // 
        this.panel1.Controls.Add(this.groupBox2);
        this.panel1.Controls.Add(this.picPanoramaImage);
        this.panel1.Controls.Add(this.groupBox1);
        this.panel1.Controls.Add(this.picVehicleImage);
        resources.ApplyResources(this.panel1, "panel1");
        this.panel1.Name = "panel1";
        // 
        // groupBox2
        // 
        this.groupBox2.Controls.Add(this.chkEnablePreview);
        this.groupBox2.Controls.Add(this.btnPrintAll);
        this.groupBox2.Controls.Add(this.btnPrint);
        this.groupBox2.Controls.Add(this.picPlateImage);
        this.groupBox2.Controls.Add(this.btnBack);
        this.groupBox2.Controls.Add(this.txtLicensePlate);
        this.groupBox2.Controls.Add(this.btnNext);
        this.groupBox2.Controls.Add(this.label3);
        this.groupBox2.Controls.Add(this.btnDel);
        this.groupBox2.Controls.Add(this.btnSave);
        resources.ApplyResources(this.groupBox2, "groupBox2");
        this.groupBox2.Name = "groupBox2";
        this.groupBox2.TabStop = false;
        // 
        // chkEnablePreview
        // 
        resources.ApplyResources(this.chkEnablePreview, "chkEnablePreview");
        this.chkEnablePreview.Name = "chkEnablePreview";
        this.chkEnablePreview.UseVisualStyleBackColor = true;
        // 
        // btnPrintAll
        // 
        resources.ApplyResources(this.btnPrintAll, "btnPrintAll");
        this.btnPrintAll.Name = "btnPrintAll";
        this.btnPrintAll.UseVisualStyleBackColor = true;
        this.btnPrintAll.Click += new System.EventHandler(this.btnPrintAll_Click);
        // 
        // btnPrint
        // 
        resources.ApplyResources(this.btnPrint, "btnPrint");
        this.btnPrint.Name = "btnPrint";
        this.btnPrint.UseVisualStyleBackColor = true;
        this.btnPrint.Click += new System.EventHandler(this.btnPrint_Click);
        // 
        // picPlateImage
        // 
        this.picPlateImage.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
        resources.ApplyResources(this.picPlateImage, "picPlateImage");
        this.picPlateImage.Name = "picPlateImage";
        this.picPlateImage.TabStop = false;
        // 
        // btnBack
        // 
        resources.ApplyResources(this.btnBack, "btnBack");
        this.btnBack.Name = "btnBack";
        this.btnBack.UseVisualStyleBackColor = true;
        this.btnBack.Click += new System.EventHandler(this.btnBack_Click);
        // 
        // txtLicensePlate
        // 
        this.txtLicensePlate.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper;
        resources.ApplyResources(this.txtLicensePlate, "txtLicensePlate");
        this.txtLicensePlate.Name = "txtLicensePlate";
        // 
        // btnNext
        // 
        resources.ApplyResources(this.btnNext, "btnNext");
        this.btnNext.Name = "btnNext";
        this.btnNext.UseVisualStyleBackColor = true;
        this.btnNext.Click += new System.EventHandler(this.btnNext_Click);
        // 
        // label3
        // 
        resources.ApplyResources(this.label3, "label3");
        this.label3.Name = "label3";
        // 
        // btnDel
        // 
        resources.ApplyResources(this.btnDel, "btnDel");
        this.btnDel.Name = "btnDel";
        this.btnDel.UseVisualStyleBackColor = true;
        this.btnDel.Click += new System.EventHandler(this.btnDel_Click);
        // 
        // btnSave
        // 
        resources.ApplyResources(this.btnSave, "btnSave");
        this.btnSave.Name = "btnSave";
        this.btnSave.UseVisualStyleBackColor = true;
        this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
        // 
        // picPanoramaImage
        // 
        this.picPanoramaImage.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
        resources.ApplyResources(this.picPanoramaImage, "picPanoramaImage");
        this.picPanoramaImage.Name = "picPanoramaImage";
        this.picPanoramaImage.TabStop = false;
        this.picPanoramaImage.DoubleClick += new System.EventHandler(this.picPanoramaImage_DoubleClick);
        // 
        // groupBox1
        // 
        this.groupBox1.Controls.Add(this.lblSpecialList);
        this.groupBox1.Controls.Add(this.chkCheckBlackSpecialList);
        this.groupBox1.Controls.Add(this.lblBlackList);
        this.groupBox1.Controls.Add(this.lblFileToPrint);
        this.groupBox1.Controls.Add(this.label4);
        this.groupBox1.Controls.Add(this.cbxOrder);
        this.groupBox1.Controls.Add(this.cbxVehicleType);
        this.groupBox1.Controls.Add(this.lblNumberRecord);
        this.groupBox1.Controls.Add(this.label1);
        this.groupBox1.Controls.Add(this.txtPlateNumber);
        this.groupBox1.Controls.Add(this.label8);
        this.groupBox1.Controls.Add(this.dtpTimeFrom);
        this.groupBox1.Controls.Add(this.dtpTimeTo);
        this.groupBox1.Controls.Add(this.btnRunReport);
        this.groupBox1.Controls.Add(this.label2);
        this.groupBox1.Controls.Add(this.labelTo);
        this.groupBox1.Controls.Add(this.dtpDateFrom);
        this.groupBox1.Controls.Add(this.dtpDateTo);
        resources.ApplyResources(this.groupBox1, "groupBox1");
        this.groupBox1.ForeColor = System.Drawing.SystemColors.ControlText;
        this.groupBox1.Name = "groupBox1";
        this.groupBox1.TabStop = false;
        // 
        // lblSpecialList
        // 
        resources.ApplyResources(this.lblSpecialList, "lblSpecialList");
        this.lblSpecialList.Name = "lblSpecialList";
        // 
        // chkCheckBlackSpecialList
        // 
        resources.ApplyResources(this.chkCheckBlackSpecialList, "chkCheckBlackSpecialList");
        this.chkCheckBlackSpecialList.Name = "chkCheckBlackSpecialList";
        this.chkCheckBlackSpecialList.UseVisualStyleBackColor = true;
        // 
        // lblBlackList
        // 
        resources.ApplyResources(this.lblBlackList, "lblBlackList");
        this.lblBlackList.Name = "lblBlackList";
        // 
        // lblFileToPrint
        // 
        resources.ApplyResources(this.lblFileToPrint, "lblFileToPrint");
        this.lblFileToPrint.Name = "lblFileToPrint";
        // 
        // label4
        // 
        resources.ApplyResources(this.label4, "label4");
        this.label4.Name = "label4";
        // 
        // cbxOrder
        // 
        this.cbxOrder.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
        this.cbxOrder.FormattingEnabled = true;
        this.cbxOrder.Items.AddRange(new object[] {
            resources.GetString("cbxOrder.Items"),
            resources.GetString("cbxOrder.Items1"),
            resources.GetString("cbxOrder.Items2")});
        resources.ApplyResources(this.cbxOrder, "cbxOrder");
        this.cbxOrder.Name = "cbxOrder";
        // 
        // cbxVehicleType
        // 
        this.cbxVehicleType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
        this.cbxVehicleType.FormattingEnabled = true;
        this.cbxVehicleType.Items.AddRange(new object[] {
            resources.GetString("cbxVehicleType.Items"),
            resources.GetString("cbxVehicleType.Items1"),
            resources.GetString("cbxVehicleType.Items2"),
            resources.GetString("cbxVehicleType.Items3")});
        resources.ApplyResources(this.cbxVehicleType, "cbxVehicleType");
        this.cbxVehicleType.Name = "cbxVehicleType";
        // 
        // lblNumberRecord
        // 
        resources.ApplyResources(this.lblNumberRecord, "lblNumberRecord");
        this.lblNumberRecord.Name = "lblNumberRecord";
        // 
        // label1
        // 
        resources.ApplyResources(this.label1, "label1");
        this.label1.Name = "label1";
        // 
        // txtPlateNumber
        // 
        this.txtPlateNumber.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper;
        resources.ApplyResources(this.txtPlateNumber, "txtPlateNumber");
        this.txtPlateNumber.Name = "txtPlateNumber";
        // 
        // label8
        // 
        resources.ApplyResources(this.label8, "label8");
        this.label8.Name = "label8";
        // 
        // dtpTimeFrom
        // 
        resources.ApplyResources(this.dtpTimeFrom, "dtpTimeFrom");
        this.dtpTimeFrom.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
        this.dtpTimeFrom.Name = "dtpTimeFrom";
        this.dtpTimeFrom.ShowUpDown = true;
        this.dtpTimeFrom.Value = new System.DateTime(2010, 8, 2, 0, 0, 0, 0);
        // 
        // dtpTimeTo
        // 
        resources.ApplyResources(this.dtpTimeTo, "dtpTimeTo");
        this.dtpTimeTo.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
        this.dtpTimeTo.Name = "dtpTimeTo";
        this.dtpTimeTo.ShowUpDown = true;
        this.dtpTimeTo.Value = new System.DateTime(2010, 11, 9, 23, 59, 59, 0);
        // 
        // btnRunReport
        // 
        resources.ApplyResources(this.btnRunReport, "btnRunReport");
        this.btnRunReport.Name = "btnRunReport";
        this.btnRunReport.UseVisualStyleBackColor = true;
        this.btnRunReport.Click += new System.EventHandler(this.btnRunReport_Click);
        // 
        // label2
        // 
        resources.ApplyResources(this.label2, "label2");
        this.label2.Name = "label2";
        // 
        // labelTo
        // 
        resources.ApplyResources(this.labelTo, "labelTo");
        this.labelTo.Name = "labelTo";
        // 
        // dtpDateFrom
        // 
        resources.ApplyResources(this.dtpDateFrom, "dtpDateFrom");
        this.dtpDateFrom.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
        this.dtpDateFrom.Name = "dtpDateFrom";
        // 
        // dtpDateTo
        // 
        resources.ApplyResources(this.dtpDateTo, "dtpDateTo");
        this.dtpDateTo.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
        this.dtpDateTo.Name = "dtpDateTo";
        // 
        // picVehicleImage
        // 
        this.picVehicleImage.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
        resources.ApplyResources(this.picVehicleImage, "picVehicleImage");
        this.picVehicleImage.Name = "picVehicleImage";
        this.picVehicleImage.TabStop = false;
        this.picVehicleImage.DoubleClick += new System.EventHandler(this.picVehicleImage_DoubleClick);
        // 
        // dataGridView1
        // 
        this.dataGridView1.AllowUserToAddRows = false;
        this.dataGridView1.AllowUserToDeleteRows = false;
        this.dataGridView1.AllowUserToResizeRows = false;
        this.dataGridView1.BackgroundColor = System.Drawing.Color.White;
        this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
        this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
            this.IDColumn,
            this.IDValueColumn,
            this.DateColumn,
            this.TimeColumn,
            this.VehicleType,
            this.PlateNumberColumn,
            this.RecognizeTimeColumn,
            this.VehicleImagePathColumn,
            this.PanoramaImagePathColumn,
            this.RedLightImagePathColumn,
            this.DescriptionColumn});
        resources.ApplyResources(this.dataGridView1, "dataGridView1");
        this.dataGridView1.Name = "dataGridView1";
        this.dataGridView1.RowHeadersVisible = false;
        this.dataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
        this.dataGridView1.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellClick);
        this.dataGridView1.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellDoubleClick);
        this.dataGridView1.CellMouseDown += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.dataGridView1_CellMouseDown);
        // 
        // IDColumn
        // 
        resources.ApplyResources(this.IDColumn, "IDColumn");
        this.IDColumn.Name = "IDColumn";
        this.IDColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
        // 
        // IDValueColumn
        // 
        resources.ApplyResources(this.IDValueColumn, "IDValueColumn");
        this.IDValueColumn.Name = "IDValueColumn";
        // 
        // DateColumn
        // 
        resources.ApplyResources(this.DateColumn, "DateColumn");
        this.DateColumn.Name = "DateColumn";
        this.DateColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
        // 
        // TimeColumn
        // 
        resources.ApplyResources(this.TimeColumn, "TimeColumn");
        this.TimeColumn.Name = "TimeColumn";
        this.TimeColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
        // 
        // VehicleType
        // 
        resources.ApplyResources(this.VehicleType, "VehicleType");
        this.VehicleType.Name = "VehicleType";
        this.VehicleType.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
        // 
        // PlateNumberColumn
        // 
        resources.ApplyResources(this.PlateNumberColumn, "PlateNumberColumn");
        this.PlateNumberColumn.Name = "PlateNumberColumn";
        this.PlateNumberColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
        // 
        // RecognizeTimeColumn
        // 
        resources.ApplyResources(this.RecognizeTimeColumn, "RecognizeTimeColumn");
        this.RecognizeTimeColumn.Name = "RecognizeTimeColumn";
        // 
        // VehicleImagePathColumn
        // 
        resources.ApplyResources(this.VehicleImagePathColumn, "VehicleImagePathColumn");
        this.VehicleImagePathColumn.Name = "VehicleImagePathColumn";
        // 
        // PanoramaImagePathColumn
        // 
        resources.ApplyResources(this.PanoramaImagePathColumn, "PanoramaImagePathColumn");
        this.PanoramaImagePathColumn.Name = "PanoramaImagePathColumn";
        // 
        // RedLightImagePathColumn
        // 
        resources.ApplyResources(this.RedLightImagePathColumn, "RedLightImagePathColumn");
        this.RedLightImagePathColumn.Name = "RedLightImagePathColumn";
        // 
        // DescriptionColumn
        // 
        resources.ApplyResources(this.DescriptionColumn, "DescriptionColumn");
        this.DescriptionColumn.Name = "DescriptionColumn";
        this.DescriptionColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
        // 
        // timer_0
        // 
        this.timer_0.Tick += new System.EventHandler(this.timer_0_Tick);
        // 
        // frmViolationReport
        // 
        this.BackColor = System.Drawing.SystemColors.InactiveCaptionText;
        resources.ApplyResources(this, "$this");
        this.Controls.Add(this.dataGridView1);
        this.Controls.Add(this.panel1);
        this.Controls.Add(this.toolStrip1);
        this.Name = "frmViolationReport";
        this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.frmViolationReport_FormClosing);
        this.Load += new System.EventHandler(this.frmViolationReport_Load);
        this.toolStrip1.ResumeLayout(false);
        this.toolStrip1.PerformLayout();
        this.panel1.ResumeLayout(false);
        this.groupBox2.ResumeLayout(false);
        this.groupBox2.PerformLayout();
        ((System.ComponentModel.ISupportInitialize)(this.picPlateImage)).EndInit();
        ((System.ComponentModel.ISupportInitialize)(this.picPanoramaImage)).EndInit();
        this.groupBox1.ResumeLayout(false);
        this.groupBox1.PerformLayout();
        ((System.ComponentModel.ISupportInitialize)(this.picVehicleImage)).EndInit();
        ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
        this.ResumeLayout(false);
        this.PerformLayout();

	}
	private void frmViolationReport_Load(object sender, System.EventArgs e)
	{
		this.cbxVehicleType.SelectedIndex = 0;
		this.cbxOrder.SelectedIndex = 0;
		this.method_3();
		if (MainForm.SystemConfiguration_0.int_17 > 0)
		{
			this.timer_0.Interval = MainForm.SystemConfiguration_0.int_17;
		}
		else
		{
			this.timer_0.Interval = 50;
		}
		this.timer_0.Start();
	}
	private void btnRunReport_Click(object sender, System.EventArgs e)
	{
		this.picVehicleImage.Image = null;
		this.picPanoramaImage.Image = null;
		this.picPlateImage.Image = null;
		this.txtLicensePlate.Text = string.Empty;
		System.DateTime dateTime = System.Convert.ToDateTime(this.dtpDateFrom.Value.ToString("yyyy/MM/dd") + " " + this.dtpTimeFrom.Value.ToString("HH:mm:ss"));
		System.DateTime dateTime2 = System.Convert.ToDateTime(this.dtpDateTo.Value.ToString("yyyy/MM/dd") + " " + this.dtpTimeTo.Value.ToString("HH:mm:ss"));
		string text = string.Concat(new object[]
		{
			"where CheckDelete = ",
			false,
			" and EventDateTime >= #",
			dateTime,
			"# and EventDateTime <= #",
			dateTime2,
			"#"
		});
		if (this.txtPlateNumber.Text != string.Empty)
		{
			string text2 = this.txtPlateNumber.Text;
			string text3 = string.Empty;
			for (int i = 0; i < text2.Length; i++)
			{
				text3 += char.ToUpper(text2[i]);
			}
			this.txtPlateNumber.Text = text3;
			text = text + " and PlateNumber like '%" + this.txtPlateNumber.Text + "%'";
		}
		this.string_0 = "Từ " + dateTime.ToString("dd/MM/yyyy HH:mm:ss") + " đến " + dateTime2.ToString("dd/MM/yyyy HH:mm:ss");
		this.string_1 = string.Empty;
		if (this.cbxVehicleType.SelectedIndex > 0)
		{
			int num = this.cbxVehicleType.SelectedIndex - 1;
			text = text + " and VehicleType = " + num;
			this.string_1 = "Loại xe: " + this.cbxVehicleType.Text;
		}
		if (this.cbxOrder.SelectedIndex == 0)
		{
			text += " order by ID DESC";
		}
		if (this.cbxOrder.SelectedIndex == 1)
		{
			text += " order by PlateNumber";
		}
		if (this.cbxOrder.SelectedIndex == 2)
		{
			text += " order by VehicleType DESC";
		}
		if (!this.chkCheckBlackSpecialList.Checked)
		{
			MainForm.SystemConfiguration_0.method_15(this.dataGridView1, text);
			this.lblBlackList.Visible = false;
			this.lblSpecialList.Visible = false;
			this.method_0();
			return;
		}
		int num2 = 0;
		int num3 = 0;
		MainForm.SystemConfiguration_0.method_16(this.dataGridView1, text, ref num2, ref num3);
		this.lblBlackList.Visible = true;
		this.lblSpecialList.Visible = true;
		this.lblBlackList.Text = "Danh sách đen: " + num2;
		this.lblSpecialList.Text = "Danh sách đặc biệt: " + num3;
		this.method_0();
	}
	private void method_0()
	{
		this.btnExport.Enabled = (this.btnPrintPreview.Enabled = (this.dataGridView1.RowCount > 0));
		this.lblNumberRecord.Text = "Số bản ghi: " + this.dataGridView1.RowCount;
		if (this.dataGridView1.RowCount > 0)
		{
			this.btnNext.Enabled = true;
			this.btnBack.Enabled = true;
			this.btnSave.Enabled = true;
			this.btnDel.Enabled = true;
			this.btnPrint.Enabled = true;
			this.btnPrintAll.Enabled = true;
			this.method_2();
			return;
		}
		this.btnNext.Enabled = false;
		this.btnBack.Enabled = false;
		this.btnSave.Enabled = false;
		this.btnDel.Enabled = false;
		this.btnPrint.Enabled = false;
		this.btnPrintAll.Enabled = false;
	}
	private void btnClose_Click(object sender, System.EventArgs e)
	{
		base.Close();
	}
	private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
	{
		if (e.RowIndex > -1)
		{
			this.btnSave.Enabled = true;
			this.btnDel.Enabled = true;
			this.btnBack.Enabled = true;
			this.btnNext.Enabled = true;
			this.method_2();
		}
	}
	private void dataGridView1_CellMouseDown(object sender, DataGridViewCellMouseEventArgs e)
	{
		if (e.RowIndex > -1)
		{
			this.dataGridView1.Rows[e.RowIndex].Selected = !this.dataGridView1.Rows[e.RowIndex].Selected;
		}
	}
	private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
	{
		string text = this.dataGridView1.CurrentRow.Cells["PlateNumberColumn"].Value.ToString();
        BO1 gClass = MainForm.SystemConfiguration_0.gclass4_0.Search(text);
		if (gClass != null)
		{
			frmBlackList frmBlackList = new frmBlackList();
			frmBlackList.method_9(true);
			frmBlackList.method_1(gClass.method_2());
			frmBlackList.method_3(gClass.method_4());
			frmBlackList.method_5(gClass.method_8());
			frmBlackList.method_7(gClass.method_16());
			frmBlackList.ShowDialog();
		}
	}
	private void btnExport_Click(object sender, System.EventArgs e)
	{
		ExportDGV.PrintTitle = "DANH SÁCH XE VI PHẠM";
		ExportDGV.PrintTitleDetail1 = this.string_0;
		ExportDGV.PrintTitleDetail2 = this.string_1;
		ExportDGV.IsLanscape = false;
		ExportDGV.HeaderHeight = 50;
		ExportDGV.DisplayPrintOption = false;
		ExportDGV.FastExport = true;
		for (int i = 0; i < this.dataGridView1.RowCount; i++)
		{
			this.dataGridView1.CurrentCell = this.dataGridView1[0, i];
			string text = this.dataGridView1.CurrentRow.Cells["PlateNumberColumn"].Value.ToString();
			this.dataGridView1.CurrentRow.Cells["PlateNumberColumn"].Value = text.Replace("-", string.Empty);
		}
		ExportDGV.Export(this.dataGridView1);
	}
	private void btnPrintPreview_Click(object sender, System.EventArgs e)
	{
		PrintDGV.PrintTitle = "DANH SÁCH XE VI PHẠM";
		PrintDGV.PrintTitleDetail1 = this.string_0;
		PrintDGV.PrintTitleDetail2 = this.string_1;
		PrintDGV.IsLandscape = true;
		PrintDGV.FitToPageWidth = true;
		PrintDGV.HeaderHeight = 50;
		PrintDGV.Print(this.dataGridView1);
	}
	private void picVehicleImage_DoubleClick(object sender, System.EventArgs e)
	{
		if (this.picVehicleImage.Image != null)
		{
			frmViewImage frmViewImage = new frmViewImage();
			frmViewImage.CurrentImage = this.picVehicleImage.Image;
			frmViewImage.ShowDialog();
		}
	}
	private void picPanoramaImage_DoubleClick(object sender, System.EventArgs e)
	{
		if (this.picPanoramaImage.Image != null)
		{
			frmViewImage frmViewImage = new frmViewImage();
			frmViewImage.CurrentImage = this.picPanoramaImage.Image;
			frmViewImage.ShowDialog();
		}
	}
	private void btnSave_Click(object sender, System.EventArgs e)
	{
		string text = this.txtLicensePlate.Text;
		int num = 0;
		MainForm.SystemConfiguration_0.method_0(text, ref num);
		string[] array = new string[]
		{
			"Xe gắn máy",
			"Xe môtô",
			"Xe ôtô"
		};
		string text2 = string.Concat(new object[]
		{
			"update tblEvent set PlateNumber = '",
			text,
			"', VehicleType = ",
			num,
			" where ID = ",
			this.dataGridView1.CurrentRow.Cells["IDValueColumn"].Value
		});
		if (MainForm.SystemConfiguration_0.iconnection_0.ExecuteCommand(text2))
		{
			this.dataGridView1.CurrentRow.Cells["PlateNumberColumn"].Value = text;
			this.dataGridView1.CurrentRow.Cells["VehicleType"].Value = array[num];
		}
	}
	private void btnDel_Click(object sender, System.EventArgs e)
	{
		if (this.dataGridView1.RowCount > 0 && this.dataGridView1.SelectedRows.Count > 0 && MessageBox.Show("Bạn có thực sự muốn xóa không?", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
		{
			foreach (DataGridViewRow dataGridViewRow in this.dataGridView1.SelectedRows)
			{
				string text = string.Concat(new object[]
				{
					"update tblEvent set CheckDelete = ",
					true,
					" where ID = ",
					dataGridViewRow.Cells["IDValueColumn"].Value
				});
				if (MainForm.SystemConfiguration_0.iconnection_0.ExecuteCommand(text))
				{
					this.dataGridView1.Rows.RemoveAt(dataGridViewRow.Index);
				}
			}
			this.method_0();
		}
	}
	private void btnNext_Click(object sender, System.EventArgs e)
	{
		if (this.dataGridView1.CurrentRow.Index < this.dataGridView1.Rows.Count - 1)
		{
			this.dataGridView1.Rows[this.dataGridView1.CurrentRow.Index + 1].Selected = true;
			this.dataGridView1.CurrentCell = this.dataGridView1[0, this.dataGridView1.CurrentRow.Index + 1];
			this.method_2();
		}
	}
	private void btnBack_Click(object sender, System.EventArgs e)
	{
		if (this.dataGridView1.CurrentRow.Index > 0)
		{
			this.dataGridView1.Rows[this.dataGridView1.CurrentRow.Index - 1].Selected = true;
			this.dataGridView1.CurrentCell = this.dataGridView1[0, this.dataGridView1.CurrentRow.Index - 1];
			this.method_2();
		}
	}
	private void btnPrint_Click(object sender, System.EventArgs e)
	{
		if (this.dataGridView1.RowCount > 0 && this.dataGridView1.SelectedRows.Count > 0)
		{
			if (this.chkEnablePreview.Checked)
			{
				if (this.dataGridView1.SelectedRows.Count == 1)
				{
					this.method_1(this.dataGridView1.CurrentRow, true);
					return;
				}
				if (MessageBox.Show("Bạn có chắc muốn xem tất cả biên bản vừa chọn không?", "Xác nhận", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes)
				{
					return;
				}
				System.Collections.IEnumerator enumerator = this.dataGridView1.SelectedRows.GetEnumerator();
				try
				{
					while (enumerator.MoveNext())
					{
						DataGridViewRow dataGridViewRow_ = (DataGridViewRow)enumerator.Current;
						this.method_1(dataGridViewRow_, true);
					}
					return;
				}
				finally
				{
					System.IDisposable disposable = enumerator as System.IDisposable;
					if (disposable != null)
					{
						disposable.Dispose();
					}
				}
			}
			if (this.dataGridView1.SelectedRows.Count == 1)
			{
				this.method_1(this.dataGridView1.CurrentRow, false);
				return;
			}
			if (MessageBox.Show("Bạn có chắc muốn in tất cả biên bản vừa chọn không?", "Xác nhận", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
			{
				foreach (DataGridViewRow obj in this.dataGridView1.SelectedRows)
				{
					this.queue_0.Enqueue(obj);
				}
			}
		}
	}
	private void btnPrintAll_Click(object sender, System.EventArgs e)
	{
		if (this.dataGridView1.RowCount > 0 && MessageBox.Show("Bạn có chắc muốn in tất cả các bản ghi trong danh sách không?", "Xác nhận", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
		{
			foreach (DataGridViewRow obj in (System.Collections.IEnumerable)this.dataGridView1.Rows)
			{
				this.queue_0.Enqueue(obj);
			}
		}
	}
	private void method_1(DataGridViewRow dataGridViewRow_0, bool bool_0)
	{
		PrintLPRInfo.CellValues = new System.Collections.Generic.List<string>
		{
			dataGridViewRow_0.Cells["DateColumn"].Value.ToString(),
			dataGridViewRow_0.Cells["TimeColumn"].Value.ToString(),
			dataGridViewRow_0.Cells["PlateNumberColumn"].Value.ToString()
		};
		string text = dataGridViewRow_0.Cells["VehicleImagePathColumn"].Value.ToString();
		if (System.IO.File.Exists(text))
		{
			PrintLPRInfo.VehicleImage = System.Drawing.Image.FromFile(text);
		}
		else
		{
			PrintLPRInfo.VehicleImage = null;
		}
		string text2 = dataGridViewRow_0.Cells["PanoramaImagePathColumn"].Value.ToString();
		if (System.IO.File.Exists(text2))
		{
			PrintLPRInfo.PanoramaImage = System.Drawing.Image.FromFile(text2);
		}
		else
		{
			PrintLPRInfo.PanoramaImage = null;
		}
		PrintLPRInfo.Print(bool_0);
	}
	private void method_2()
	{
		if (this.dataGridView1.RowCount > 0)
		{
			string text = this.dataGridView1.CurrentRow.Cells["VehicleImagePathColumn"].Value.ToString();
			if (System.IO.File.Exists(text))
			{
				this.picVehicleImage.Image = System.Drawing.Image.FromFile(text);
			}
			else
			{
				this.picVehicleImage.Image = null;
			}
			if (System.IO.File.Exists(text + ".jpg"))
			{
				this.picPlateImage.Image = System.Drawing.Image.FromFile(text + ".jpg");
			}
			else
			{
				this.picPlateImage.Image = null;
			}
			string text2 = this.dataGridView1.CurrentRow.Cells["PanoramaImagePathColumn"].Value.ToString();
			if (System.IO.File.Exists(text2))
			{
				this.picPanoramaImage.Image = System.Drawing.Image.FromFile(text2);
			}
			else
			{
				this.picPanoramaImage.Image = null;
			}
			this.txtLicensePlate.Text = this.dataGridView1.CurrentRow.Cells["PlateNumberColumn"].Value.ToString();
			this.txtLicensePlate.Focus();
			this.txtLicensePlate.SelectionStart = this.txtLicensePlate.Text.Length;
		}
	}
	protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
	{
		if (msg.Msg == 256 || msg.Msg == 260)
		{
			if (keyData <= Keys.End)
			{
				if (keyData != Keys.Return)
				{
					if (keyData == Keys.End)
					{
						if (this.btnDel.Enabled)
						{
							this.btnDel_Click(null, null);
						}
					}
				}
				else
				{
					if (this.btnSave.Enabled)
					{
						this.btnSave_Click(null, null);
					}
				}
			}
			else
			{
				switch (keyData)
				{
				case Keys.Up:
					if (this.btnBack.Enabled)
					{
						this.btnBack_Click(null, null);
					}
					break;
				case Keys.Right:
					break;
				case Keys.Down:
					if (this.btnNext.Enabled)
					{
						this.btnNext_Click(null, null);
					}
					break;
				default:
					if (keyData == Keys.Insert)
					{
						if (this.btnPrint.Enabled)
						{
							this.btnPrint_Click(null, null);
						}
					}
					break;
				}
			}
		}
		return base.ProcessCmdKey(ref msg, keyData);
	}
	private void timer_0_Tick(object sender, System.EventArgs e)
	{
		if (!this.backgroundWorker_0.IsBusy && this.queue_0.Count > 0)
		{
			this.backgroundWorker_0.RunWorkerAsync();
		}
		this.lblFileToPrint.Text = "Số file còn phải in: " + this.queue_0.Count;
	}
	private void method_3()
	{
		try
		{
			this.backgroundWorker_0 = new BackgroundWorker();
			this.backgroundWorker_0.WorkerSupportsCancellation = true;
			this.backgroundWorker_0.WorkerReportsProgress = true;
			this.backgroundWorker_0.DoWork += new DoWorkEventHandler(this.backgroundWorker_0_DoWork);
			this.backgroundWorker_0.RunWorkerCompleted += new RunWorkerCompletedEventHandler(this.backgroundWorker_0_RunWorkerCompleted);
			this.backgroundWorker_0.ProgressChanged += new ProgressChangedEventHandler(this.backgroundWorker_0_ProgressChanged);
		}
		catch (System.Exception ex)
		{
			this.ilog_0.Error(ex);
		}
	}
	private void backgroundWorker_0_DoWork(object sender, DoWorkEventArgs e)
	{
		BackgroundWorker backgroundWorker = sender as BackgroundWorker;
		if (!backgroundWorker.CancellationPending && this.queue_0.Count > 0)
		{
			DataGridViewRow dataGridViewRow_ = (DataGridViewRow)this.queue_0.Dequeue();
			this.method_1(dataGridViewRow_, false);
		}
	}
	private void backgroundWorker_0_ProgressChanged(object sender, ProgressChangedEventArgs e)
	{
	}
	private void backgroundWorker_0_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
	{
	}
	public void method_4()
	{
		if (this.backgroundWorker_0 != null)
		{
			this.backgroundWorker_0.DoWork -= new DoWorkEventHandler(this.backgroundWorker_0_DoWork);
			this.backgroundWorker_0.RunWorkerCompleted -= new RunWorkerCompletedEventHandler(this.backgroundWorker_0_RunWorkerCompleted);
			this.backgroundWorker_0.ProgressChanged -= new ProgressChangedEventHandler(this.backgroundWorker_0_ProgressChanged);
			this.backgroundWorker_0.CancelAsync();
			this.backgroundWorker_0 = null;
		}
	}
	private void frmViolationReport_FormClosing(object sender, FormClosingEventArgs e)
	{
		this.timer_0.Stop();
		this.method_4();
	}
}
